import {Route, Navigate,Routes } from 'react-router-dom'
import Home from '../../../src/views/Home/index'
import NotPermission from '../../views/NotPermission/index'

import React, { Component } from 'react'

export default class index extends Component {
  render() {
    const localRouterMap = [
        {
            key:'/home',
            components:'<Home/>'
        }
    ]
    return (
      <div>
          <Routes>
                {
                    localRouterMap.map(item => {
                        return <Route
                            path={item.key}
                            key={item.key}
                            element={item.components}
                            exact
                        ></Route>
                    })
                }
                <Route path="/" element={<Navigate to="/home" />} />
                <Route path="*" component={NotPermission}></Route>
            </Routes>
      </div>
    )
  }
}
